import request from '@/utils/httpRequest/request'

const url = {
    // cityList: "http://apis.juhe.cn/springTravel/citys",
    // getPolicy: "http://apis.juhe.cn/springTravel/query",
    // getFacilites: "http://apis.juhe.cn/springTravel/hsjg",
    cityList: "https://v2.alapi.cn/api/springTravel/city",
    getPolicy: "https://v2.alapi.cn/api/springTravel/query",
    getFacilites: "http://apis.juhe.cn/springTravel/hsjg"
};
const proxy = "/api/proxy"
const token = "FaA0tE6QKFBZS8dw"
const key = "a9340eddea96d64387da8c915e76da91";
export const policy = {
    cityList: function() {
        return request({
            url: proxy,
            method: "get",
            params: {
                url: url.cityList + "?token=" + token,
                // key: key,
                // token: token,
            }
        });
    },
    getPolicy: function(fromId, toId) {
        return request({
            url: proxy,
            method: "get",
            params: {
                url: url.getPolicy + "?from=" + fromId + "&to=" + toId + "&token=" + token,
                // from: fromId,
                // to: toId,
                // key: key,
                // token: token,
            }
        });
    },
    getFacilities: function(id) {
        return request({
            url: proxy,
            method: "get",
            params: {
                url: url.getFacilites + "?city_id=" + id + "&key=" + key,
            },
        });
    },
};